package cn.wikiflyer.beikang.bean;

import java.io.Serializable;
import java.util.ArrayList;

import cn.wk.libs4a.utils.WKMathUtils;
import cn.wk.libs4a.view.adview.ADViewBean;

/**
 * 首页数据Bean
 */
public class HomeBean {

	public ArrayList<BannerBean> ad;
	public ArrayList<HomeNewsBean> news;
	public ArrayList<ActivityBean> activity;

	public ArrayList<ADViewBean> parseAD() {
		ArrayList<ADViewBean> tempAD = new ArrayList<ADViewBean>();
		for (int i = 0; i < ad.size(); i++) {
			ADViewBean bean = new ADViewBean(ad.get(i).ad_image, ad.get(i).url);
			tempAD.add(bean);
		}
		return tempAD;
	}

	/**
	 * 顶部广告图
	 */
	public class BannerBean {
		public String id;
		public String catid;
		public String typeid;
		public String title;
		public String style;
		public String thumb;
		public String keywords;
		public String description;
		public String posids;
		public String url;
		public String listorder;
		public String status;
		public String sysadd;
		public String islink;
		public String username;
		public String inputtime;
		public String updatetime;
		public String ad_image;
		public String link_url;
		public String is_show;
		public String start_time;
		public String end_time;
	}

	/**
	 * 咨询
	 */
	public class HomeNewsBean{
		public String id;
		public String catid;
		public String typeid;
		public String title;
		public String style;
		public String thumb;
		public String keywords;
		public String description;
		public String posids;
		public String url;
		public String listorder;
		public String status;
		public String sysadd;
		public String islink;
		public String username;
		public String inputtime;
		public String updatetime;
	}

	/**
	 * 活动
	 */
	public class ActivityBean{
		public String id;
		public String catid;
		public String typeid;
		public String title;
		public String style;
		public String thumb;
		public String keywords;
		public String description;
		public String posids;
		public String url;
		public String listorder;
		public String status;
		public String sysadd;
		public String islink;
		public String username;
		public String inputtime;
		public String updatetime;
	}
	
	/**
	 * 测试数据
	 */
	public static class TestTools implements Serializable {

		public static String getAImage() {
			return "http://www.wikiflyer.cn/images/al/s"
					+ WKMathUtils.getNum(1, 6) + ".jpg";
		}

		public static String getATarggetUrl() {
			return "http://www.baidu.com";
		}

		public static String getLogo() {
			String[] str = {
					"http://www.wikiflyer.cn/images/link/aixinyichu.jpg",
					"http://www.wikiflyer.cn/images/link/bcghk.jpg",
					"http://www.wikiflyer.cn/images/link/blueflame.jpg",
					"http://www.wikiflyer.cn/images/link/cntv.jpg" };
			return str[WKMathUtils.getNum0(str.length)];
		}

		public static String getATime() {
			return "2014-07-06";
		}
	}
}
